import 'package:flutter/cupertino.dart';
import 'package:myapp/bean/article.dart';
import 'package:myapp/ui/article_detail_page.dart';
import 'package:myapp/ui/search_page.dart';

class RouteName {
  static const String SEARCH_PAGE = "search_page";
  static const String ARTICLE_DETAIL_PAGE = "article_detail_page";
}


Route<dynamic> generateInitialRoutes(RouteSettings settings) {
  switch (settings.name) {
    case RouteName.SEARCH_PAGE:
      return CupertinoPageRoute(builder: (context) => SearchPage());
    case RouteName.ARTICLE_DETAIL_PAGE:
      var  article= settings.arguments as Article;
      return CupertinoPageRoute(builder: (context) => ArticleDetailPage(article: article,));
  }
  return null;
}
